package com.appbee.core.client.shell;

import javax.inject.Inject;

import com.appbee.core.client.design.PageStyle;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;

public class Shell extends Composite implements IShell
{

	private static ShellUiBinder uiBinder = GWT.create(ShellUiBinder.class);

	interface ShellUiBinder extends UiBinder<Widget, Shell>
	{
	}
	
	@UiField
	FlowPanel mainPanel;
	
	@UiField(provided=true)
	PageStyle style;

	@Inject
	public Shell(PageStyle style)
	{
		this.style = style;
		initWidget(uiBinder.createAndBindUi(this));
	}

	@Override
	public HasWidgets.ForIsWidget getMainPanel()
	{
		return mainPanel;
	}

	@Override
	public void setMainPanelStyleName(String styleName)
	{
		mainPanel.setStyleName(styleName);
	}

}
